/* eslint-disable */
function removal(a) {
    let newArr = a.reduce(
        (unique, item) => (unique.includes(item) ? unique : [...unique, item]),
        []
    );
    return newArr;
}

console.log(removal(['4', '5', '6', '5', '8']));

//懒加载：当文件需要使用时才会加载
//预加载：prefetch:会在使用前题前加载js
//预加载跟普通加载区别：正常加载可认为是并行加载（同一时间加载多个文件），预加载会等其他文件加载完，浏览器空闲了再偷偷加载文件
document.getElementById('testId').onclick = function () {
    import(/* webpackChunkName:'other',webpackPrefetch:true */ './other')
        .then(({ take }) => {
            console.log(take(3, 4));
        })
        .catch(() => {
            console.log('加载失败');
        });
};
